home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d15 / maximo_1.arc / TXT.ARC / TOURSUBS.TXT < prev    next >
Text File  |  1991-08-20  |  9KB  |  348 lines

  1. ;
  2. ; GETCMD -- process input to conversation box
  3. ;                  (c) 1990 Chris Butler
  4.  
  5.  
  6. ;        uses buffer 5 for temp 
  7.  
  8. getcmd:
  9. noise 100 100 10
  10. local bndryoff (@boxllx+417)%8 ; boundary offset
  11. local flashon "1"           ; flash toggle
  12. cgetbuf 5 @boxllx+417,@boxlly+97 @boxllx+481,@boxlly+108 0 0 ; CONT keytop 
  13.  
  14. cmdloop:
  15. color @keycolor
  16.   if @flashon
  17.       rect @boxllx+417,@boxlly+97 @boxllx+481,@boxlly+108 0 0 ; blank CONT key 
  18.       local flashon "0"
  19.     else
  20.       putup @bndryoff,0 5
  21.       local flashon "1"
  22.     endif
  23. ;  waitkey 15 nokeyyet
  24.   waitkey 40 cmdloop
  25.   ifkey b cmdb c cmdc h cmdh m cmdm s cmds left cmdb right cmdc "?" cmdh
  26.   ifkey "B" cmdb "C" cmdc "H" cmdh "M" cmdm "S" cmds ESC cmdm RETURN cmdc
  27.   noise 100,1000 10
  28.   goto cmdloop
  29.   nokeyyet:
  30.   ifmouse 1,gotbttn,,,,,,15,cmdloop    ; disabled 11/3/90
  31.   gotbttn:
  32.   getmouse but x,y
  33.   if (@x<@boxllx)||(@x>@boxllx+@boxw)||(@y<@boxlly+94)||(@y>@boxlly+111) badlocn
  34.                 ; test if x,y is in menu bar
  35.   if @x<(@boxllx+66) cmdb
  36.   if @x<(@boxllx+119) cmdm
  37.   if @x<(@boxllx+166) cmdh
  38.   if @x<(@boxllx+350) badlocn
  39.   if @x<(@boxllx+414) cmds
  40.   if @x<(@boxllx+484) cmdc
  41.  
  42. badlocn:
  43.   noise 1000,100 10
  44.   goto cmdloop
  45.  
  46. cmdb: 
  47.   set bttnx @boxllx+"4"  ; backup button
  48.   set w "62"
  49.   putup @bndryoff,0 5 ; make sure keytop lettering in place            
  50.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor ; "95"=y offset height for button
  51.   return "backup"
  52. cmdc: 
  53.   set bttnx @boxllx+414 ; continue button
  54.   set w "70"
  55.   putup @bndryoff,0 5 ; make sure keytop lettering in place            
  56.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor     ;
  57.   return "continue"
  58. cmdh: 
  59.   set bttnx @boxllx+"119" ; help button
  60.   set w "47"
  61.   putup @bndryoff,0 5 ; make sure keytop lettering in place            
  62.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor     ;
  63.   gosub convhelp
  64.   goto cmdloop
  65. cmdm: 
  66.   set bttnx @boxllx+"66"    ; menu button
  67.   set w "53"
  68. ;  putup @bndryoff,0 5 ; make sure keytop lettering in place            
  69.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor     ;
  70.   gosub menu_cmd
  71.   goto cmdloop
  72. cmds: 
  73.   set bttnx @boxllx+"350"  ; screen button
  74.   set w "64"
  75.   putup @bndryoff,0 5 ; make sure keytop lettering in place            
  76.   pushbutton @bttnx,@boxlly+94,@h,@w,@keycolor     ;
  77.   screen
  78.   color @keycolor
  79.   goto cmdloop
  80.  
  81. done: 
  82. return    ; subr GETCMD 
  83.  
  84.  
  85. ;
  86. ;  SCREEN -- temporarily remove CONVBOX from screen
  87. ;
  88. screen:
  89. cfree 3           ; dump blank convbox
  90. cgetbuf 3 @boxllx,@boxlly @boxllx+@boxw,@boxlly+117 1 0 ; save current convbox
  91. putup 0,0 2          ; restore original convbox
  92. color 0,15
  93. box @boxllx,@boxlly @boxllx+@boxw,@boxlly+115 2 ; outline box to replace convbox
  94. fload russell
  95. fstyle 6 2 2 
  96. text @boxllx+100,@boxlly+50 "type R to Restore"
  97. cgetbuf 4 @boxllx,@boxlly @boxllx+@boxw,@boxlly+119 1 0 ;save orig w/restore msg
  98. waitkey 50
  99.  
  100. littloop:
  101. putup 0,0 2
  102. ifmouse 1 littlp4,,,,,, 20 littlp1
  103. littlp1:
  104. waitkey 20 littlp2
  105. ifkey r littlp4 "R" littlp4 ; want r/R to "restore"
  106. noise 100,1000 30
  107. goto littlp2
  108. littlp2:
  109. putup 0,0 4
  110. ifmouse 1 littlp4,,,,,, 20 littlp3
  111. littlp3:
  112. waitkey 20 littloop
  113. ifkey r littlp4 "R" littlp4 ; want r/R to "restore"
  114. noise 100,1000 30
  115. goto littloop
  116. littlp4:
  117.  
  118. putup 0,0 3    ; replace original
  119. fload ibm16    ; restore orig font
  120. fstyle 0    ; turn off shadowing
  121. return        ; subr SCREEN
  122.  
  123.  
  124. ;
  125. ;  CONVHELP -- putup help for CONVBOX
  126. ;         uses buffer 3
  127. ;         called from GETCMD    
  128.  
  129. convhelp:
  130. local sidemarg 3
  131. local bottmarg 2
  132. local rim 5
  133. local picdim 80
  134.  
  135. local fotollx @boxllx+@rim+@sidemarg
  136. local fotolly @boxlly+@rim+@bottmarg+1
  137. local fotourx @boxllx+@boxw-(@sidemarg+@rim+1)
  138. local fotoury @boxlly+@rim+@bottmarg+@picdim+2
  139. local flashon 0
  140.  
  141. cgetbuf 3 @fotollx,@fotolly @fotourx,@fotoury 1 0;
  142. local txtoff (@fotollx)%8 ; boundary offset of clipping
  143. local contoff (@boxllx+417)%8 ; boundary offset of clipping
  144.  
  145. color @txtboxclr
  146. rect @fotollx+1,@fotolly+1 @fotourx,@fotoury ; blank out fotos+txt
  147. cload cwhelp 1 1 0        ; help panel
  148. putup @fotollx+16,@fotolly+1 1     
  149. color @keycolor
  150.  
  151. helploop:
  152.   if @flashon
  153.       rect @boxllx+417,@boxlly+97 @boxllx+481,@boxlly+108 0 0 ; blank CONT key 
  154.       local flashon "0"
  155.     else
  156.       putup @contoff,0 5
  157.       local flashon "1"
  158.     endif
  159. ifmouse 1 helpdone,,,,,, 20 helplp1
  160. helplp1:
  161. waitkey 20 helploop
  162. helpdone:
  163.  
  164. putup @txtoff,0 3          ; restore original convbox
  165.  
  166. return        ; subr CONVHELP
  167.  
  168. ;  MENU_CMD -- LINK BACK TO MAIN MENU IN MASTER
  169. ;
  170. ;        uses cbuf 3 (temp)
  171. ;
  172. menu_cmd:
  173. local sidemarg 3
  174. local bottmarg 2
  175. local rim 5
  176. local picdim 80
  177.  
  178. local fotollx @boxllx+@rim+@sidemarg
  179. local fotolly @boxlly+@rim+@bottmarg+1
  180. local fotourx @boxllx+@boxw-(@sidemarg+@rim+1)
  181. local fotoury @boxlly+@rim+@bottmarg+@picdim+2
  182. local flashon 0
  183.  
  184. cgetbuf 3 @fotollx,@fotolly @fotourx,@fotoury 1 0;
  185. local txtoff (@fotollx)%8 ; boundary offset of clipping
  186. local contoff (@boxllx+417)%8 ; boundary offset of clipping
  187.  
  188. color @txtboxclr
  189. rect @fotollx+1,@fotolly+1 @fotourx,@fotoury ; blank out fotos+txt
  190. cload menuwarn 1 1 0        ; help panel
  191. putup @fotollx+16,@fotolly+1 1     
  192. color @keycolor
  193. waitkey
  194. ifkey "M" menu_out m menu_out
  195.   putup @txtoff,0 3          ; restore original convbox
  196.   return
  197. menu_out:
  198.   link master.txt @entrypoint
  199.  
  200. ; END SUBR MENU_CMD
  201.  
  202. ;
  203. ;
  204. ;  PUSHBUTTON -- actuate onscreen "button"
  205. ;            uses MS Windows button format (white #15 top line and
  206. ;            2 bars of gray #8 shading)
  207. ;
  208. pushbutton:
  209. local llx @1    ; lower left corner of button x
  210. local lly @2    ; lower left corner          y
  211. local h @3    ; height
  212. local w @4    ; width
  213. local keycolor @5 ; color of keytop 
  214.         ; note: uses buffer 1 
  215.  
  216. local bndryoff (@llx+2)%8 ; boundary offset (@llx+2=x start of clipping)
  217. set wait "0"  ; diagnostic switch
  218.  
  219. cgetbuf 1 @llx+2,@lly+3 @llx+@w-3,@lly+@h-2 0 0; grab center of button color @keycolor    
  220. if @wait
  221.   waitkey 
  222. endif
  223. line @llx+1,@lly+1 @llx+1,@lly+@h-1 ; gray out left white line
  224. line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1 ; gray out top white line
  225.  
  226. putup 1+@bndryoff,-1 1
  227. color @keycolor
  228.  
  229. point @llx+2,@lly+2 
  230. point @llx+@w-2,@lly+@h-2
  231. if @wait
  232.   waitkey 
  233. endif
  234.  
  235. putup 2+@bndryoff,-2 1
  236. point @llx+2,@lly+1 
  237. point @llx+3,@lly+1
  238. point @llx+@w-1,@lly+@h-2
  239. point @llx+@w-1,@lly+@h-3
  240. color 8
  241. line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1
  242. color 0
  243. line @llx+1,@lly+1 @llx+1,@lly+@h-1
  244. if @wait
  245.   waitkey 
  246. endif
  247.  
  248. putup 1+@bndryoff,-1 1
  249. color 7
  250. line @llx+2,@lly+1 @llx+@w-1,@lly+1
  251. line @llx+@w-1,@lly+1 @llx+@w-1,@lly+@h-2
  252. color @keycolor
  253. line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1
  254. line @llx+1,@lly+1 @llx+1,@lly+@h-1
  255. if @wait
  256.   waitkey 
  257. endif
  258.  
  259.  
  260. cgetbuf 1 @llx+3,@lly+1 @llx+@w-1,@lly+@h-3 0 0 ;
  261. putup @bndryoff,1 1  ; new clipping from lr corner
  262. color 15
  263. line @llx+1,@lly+1 @llx+1,@lly+@h-1
  264. line @llx+1,@lly+@h-1 @llx+@w-1,@lly+@h-1
  265. color 7
  266. point @llx+1,@lly+1        ; ll corner
  267. point @llx+@w-1,@lly+@h-1    ; tr corner
  268. if @wait
  269.   waitkey 
  270. endif
  271.  
  272. return ; subr PUSHBUTTON
  273.  
  274. ;
  275. ;  MAXTALK -- set palette to (de-)highlight Max's photo box
  276. ;       -- called w/@1 = 1 then highlight Max
  277. ;  
  278. maxtalk:
  279. if @1
  280.     putup @boxllx+8,@boxlly+9 30
  281.     putup @boxllx+400,@boxlly+9 32
  282.  
  283.  else
  284.     putup @boxllx+8,@boxlly+9 32
  285.     putup @boxllx+400,@boxlly+9 31
  286. endif
  287. return    ; MAXTALK subr
  288.  
  289. ;
  290. ;  SAY -- put speech into the conversation box
  291. ;        @1 speaker (1=max,0=other)    
  292. ;        @2 first text string
  293. ;        @3 second text string
  294. ;
  295.  
  296. say:
  297. fload ibm16
  298. color @txtboxclr
  299. rect @boxllx+94,@boxlly+9 @boxllx+394,@boxlly+89
  300. waitkey 50
  301. color 0
  302. maxtalk @1
  303. window @boxllx+100,@boxlly+13 @boxllx+390,@boxlly+87
  304. text @2 3
  305. text @3 3
  306. window
  307. return      ; subr SAY
  308.  
  309. ;
  310. ;  NEWBGRND  -- installs new bgrnd and convbox
  311. ;        @1 = new pic name
  312. ;        @2 = new conv box llx (must be byte boundary)
  313. ;        @3 = new conv box lly
  314. ;        @4 = 1 => maxtalk (hilite max's box)
  315. ;        @5 = 1 => install new palette
  316. ;        @6 = delay between pic and convbox
  317. ;        @7 = pic fade to use 
  318. ;        **   puts orig under convbox in buffer 2
  319.  
  320. newbgrnd:
  321. set boxllx @2
  322. set boxlly @3
  323. pload @1 1
  324. if @5
  325.  palette 1
  326. endif
  327. pfade @7 1
  328. pfree 1
  329.  
  330. cgetbuf 2 @boxllx,@boxlly @boxllx+@boxw,@boxlly+@boxh 1 0 ; save orig to buff 2
  331. cload smbox2.clp 3 1 0    ; blank convbox to buffer 3
  332. waitkey @6            ; delay before conv box
  333. putup @boxllx,@boxlly 3     ; putup conv box
  334. cfree 3
  335. putup @boxllx+8,@boxlly+9 30    ; max foto
  336. putup @boxllx+400,@boxlly+9 31    ; other foto
  337. if @4
  338.   maxtalk 1
  339.  else
  340.   maxtalk 0
  341. endif
  342.  
  343. fload normal.fnt        ; label for convbox
  344. color 0
  345. text @boxllx+177,@boxlly+99 @boxtitle
  346. fload ibm16
  347. return    ; subr NEWBGRND
  348.